#include-once
#include '..\Editors.au3'
#include '..\UDFs\ScintillaExt.au3'
#include '..\UDFs\ScintillaAu3.au3'

Global Const $gzEDITORS_IDAUTOITSCRIPTEDITOR = _Editors_Register('AutoIt3 Script Editor', _
			'au3', __AutoItScriptEditor_MessageHandler, __AutoItScriptEditor_NotifyHandler)


Local $__gAutoItScriptEditor_hWnd = 0

Func __AutoItScriptEditor_MessageHandler($uMsg, $vParam, ByRef $rParam)
	Switch $uMsg
		Case $gnEDITORS_EM_POSTREGISTER	;$gnEDITORS_EM_POSTREGISTER, $zEditorId
			__AutoItScriptEditor_Init()
		Case $gnEDITORS_EM_CREATE		;$gnEDITORS_EM_CREATE, $hParentView, $aClientSize
			$__gGeneralTextEditor_hWnd = _ScintillaExt_Create($hParentView, _
						$aClientSize[0], $aClientSize[1], $aClientSize[2], $aClientSize[3])
		Case $gnEDITORS_EM_DESTROY		;$gnEDITORS_EM_DESTROY, 0, 0
			_ScintillaExt_Destroy($__gGeneralTextEditor_hWnd)
		Case $gnEDITORS_EM_ACTIVATE		;$gnEDITORS_EM_ACTIVATE, $aDocumentIds, $bSameEditor
			;$aDocumentIds[0]: New Document, $aDocumentIds[1]: Old Document

		Case $gnEDITORS_EM_DEACTIVATE	;$gnEDITORS_EM_ACTIVATE, $sDocumentId

	EndSwitch
EndFunc

Func __AutoItScriptEditor_NotifyHandler($uCode, $vParam, ByRef $rParam)
	Switch $uCode

	EndSwitch
EndFunc

Func __AutoItScriptEditor_Init()
	; Load properties
	;
EndFunc